package top.bfylu.command.remote;

/**
 * 包名: top.bfylu.command.remote
 * 创建时间: 2022/2/7
 *
 * @author bfy
 * @version 1.0.0
 * <p>
 * 描述:
 * @Email bfyjian@gmail.com
 **/
public class LightOnCommand implements Command{
    Light light;

    public LightOnCommand(Light light) {
        this.light = light;
    }

    @Override
    public void execute() {
        light.on();
    }

    /**
     * execute()打开电灯，所以undo()该做的事情就是关闭电灯
     */
    @Override
    public void undo() {
        light.off();
    }
}
